home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 352_01 / vecznorm.cpp < prev    next >
C/C++ Source or Header  |  1991-04-22  |  591b  |  23 lines

  1. //////// COMPLEX VECTORS
  2. //
  3. // VECZNORM.CPP
  4. //        norm  of a complex vector = sum of norms of complex elements
  5. //        also equals sum of norms of real and imag vector parts.
  6. //
  7. #include <stdlib.h>
  8. #include <alloc.h>
  9. #include <string.h>
  10. #include "wtwg.h"
  11.  
  12. #include "dblib.h"
  13.  
  14. #include "vector.h"
  15.  
  16. float norm (CVector& vec,  int n1, int n2 )
  17.     // norm between point1 and point2    (friend function of CVector)
  18.     // if point2 == -1, sums to end of V.
  19.         {
  20.         return ( norm(vec.x,n1,n2) + norm(vec.y,n1,n2) );
  21.         }
  22. //---------------------- end VECZNORM.CPP ----------------------------
  23.